<template>
  <div class="layout">
    <div class="table-layout">
      <div class="table-header">
        <el-row>
          <el-form ref="queryForm" :inline="true" :model="queryParams" class="demo-form-inline">
            <el-form-item label="案件名称" prop="c12">
              <el-input v-model="queryParams.c12" placeholder="请输入" clearable />
            </el-form-item>
            <el-form-item label="立案时间" prop="c4">
              <el-date-picker
                v-model="queryParams.c4"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="请选择"
              />
            </el-form-item>
            <el-form-item>
              <el-button type="primary" icon="el-icon-search" @click="searchHandle">查询</el-button>
              <el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
            </el-form-item>
          </el-form>
        </el-row>
      </div>
      <div class="table-body">
        <el-table :data="tableData" style="width: 100%" height="100%" stripe @selection-change="handleSelectionChange">
          <el-table-column type="index" label="序号" width="50" />
          <el-table-column align="left" prop="ajmc" label="案件名称" min-width="200" />
          <el-table-column align="center" prop="sah" width="180" label="受案号" />
          <el-table-column align="center" prop="ajlb" label="案件类型" />
          <el-table-column align="center" prop="lasj" label="立案时间" />
          <el-table-column align="center" prop="ysjg" label="移送机关" />
          <el-table-column align="center" prop="ajyjrq" label="案卷移交日期" />
          <el-table-column align="center" prop="lzzt" label="案件流转状态" />
          <el-table-column align="center" prop="spqx" label="审批期限" />
          <el-table-column align="center" prop="cjsj" label="创建时间" />
          <el-table-column align="center" label="操作" width="100">
            <template slot-scope="scope">
              <el-link type="primary" @click="handleClick(scope.row)">办理</el-link>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="table-footer">
        <pagination
          background
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
          :page.sync="pageParams.pageNum"
          :limit.sync="pageParams.pageSize"
          @pagination="getList"
        />
      </div>
    </div>
    <el-drawer
      title="办理"
      :visible.sync="drawerOpen"
      append-to-body
      size="900px"
      custom-class="dv_drawer"
    >
      <formDetail ref="formBox" :type="'add'" :show-flag="false" />
      <div class="drawer-footer">
        <el-button @click="drawerOpen=false">取 消</el-button>
        <el-button type="primary">确 定</el-button>
      </div>
    </el-drawer>
  </div>
</template>

<script>
import page_common from '@/views/mixins/page_common.js'
import formDetail from '../../caseEntry/arrest/form.vue'
export default {
  name: 'Arrest',
  components: { formDetail },
  mixins: [page_common],
  data() {
    return {
      queryParams: { c12: '', c4: '' },
      tableData: [],
      dialogVisible: false,
      drawerOpen: false,
      type: ''
    }
  },
  created() {
    this.searchHandle()
  },
  methods: {
    getList() {
      this.tableData = [
        {
          ajmc: '王某涉嫌故意伤害罪审查起诉案‌',
          sah: '（2025）豫0301刑捕0012号',
          ajlb: '审查起诉',
          ysjg: '郑州市公安局惠济分区',
          lasj: '2025-03-01',
          ajyjrq: '2025-03-02',
          lzzt: '继续侦查',
          spqx: '22小时54分钟',
          cjsj: '2025-03-03',
          status: 3,
          gajgForm: {
            ajmc: '张某涉嫌组织、领导黑社会性质组织罪审查起诉案‌',
            sah: '（2025）豫0108刑捕0001号',
            xyrmc: '张某',
            rs: '10',
            lasj: '2025-03-01',
            ay: '涉嫌组织、领导黑社会性质组织罪审查',
            qzcs: '2025-01-02',
            zcjg: '惠济区检察院',
            fzshr: '李某',
            fjrd: ''
          }, form1: {
            c1: '1',
            c2: '1',
            c3: '',
            c4: '',
            c5: '1',
            c6: '',
            c7: '1',
            c8: ''
          }
        }
      ]
    },
    handleClick(rowData) {
      this.drawerOpen = true
      this.$nextTick(() => {
        this.$refs.formBox.init(rowData, 'add')
      })
    }

  }
}
</script>

<style scoped lang='scss'>

</style>
